home *** CD-ROM | disk | FTP | other *** search
- {****************************************************************************
- * *
- * EllpSavr.pas: Plug-in animation module for SSaveDem.pas *
- * *
- * Rev. 0.1 19.4.93 MK IR *
- * *
- ****************************************************************************}
-
- { Name for this Screen Saver - shows up in Control Panel: }
- {$D SCRNSAVE Ellipses }
-
- const AppName: PChar = 'Screen Saver.Ellipses' ;
-
- type
- PMySaverWin = ^TMySaverWin;
- TMySaverWin = Object(TScSaverWin)
- procedure DoTheShow; virtual;
- end;
-
- {****************************************************************************
- * *
- * T M y S a v e r W i n . D o T h e S h o w *
- * *
- * Paints four ellipses around the screen center (clover-like). *
- * *
- ****************************************************************************}
-
- procedure TMySaverWin.DoTheShow ;
-
- var TheDC: hDC;
- NewBrush, OldBrush: hBrush;
- x,y,zx,zy,sx,sy: integer;
-
- begin
-
- TheDC := TestHandle (GetDC (hWindow));
-
- NewBrush := TestHandle (CreateSolidBrush { create random brush }
- ({GetNearestColor (TheDC,}rgb(random(256),random(256), random(256)))){)};
- OldBrush := TestHandle (SelectObject (TheDC, NewBrush));
-
- zx := GetSystemMetrics (SM_CXSCREEN) ;
- zy := GetSystemMetrics (SM_CYSCREEN) ;
- randomize;
- sx := random (zy div 2); { get a random size }
- sy := random (zy div 2);
- for x := 0 to 1 do { paint four ellipses }
- for y := 0 to 1 do
- Ellipse (TheDC, zx div 2, zy div 2, sx+x*(zx-2*sx), sy+y*(zy-2*sy));
-
- TestHandle (SelectObject (TheDC, OldBrush));
- DeleteObject (NewBrush);
- ReleaseDC (hWindow, TheDC);
- end; { DoTheShow }
-
-